﻿<Window x:Class="AssignmentsManage.Windows.LinkedFilesWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dc="clr-namespace:AssignmentsManage.DataClasses"
        xmlns:con="clr-namespace:AssignmentsManage.Converters"
        xmlns:ctr="clr-namespace:AssignmentsManage.Control"
        xmlns:ext="clr-namespace:Xceed.Wpf.Toolkit;assembly=WPFToolkit.Extended"
        
        xmlns:Engine="clr-namespace:WPFLocalizeExtension.Engine;assembly=WPFLocalizeExtension"
        xmlns:lex="clr-namespace:WPFLocalizeExtension.Extensions;assembly=WPFLocalizeExtension"
        Engine:LocalizeDictionary.DesignCulture="en"
        
        Title="{lex:LocText Key=titleLinkedFiles, Dict=Strings, Assembly=AssignmentsManage}" Height="407" Width="519" xmlns:my="clr-namespace:AssignmentsManage.Windows" WindowStartupLocation="CenterOwner">
    <Window.Resources>
        <con:FileToIconConverter x:Key="FileToIconConverter1" />
    </Window.Resources>
    <Grid>
        <Label Content="{lex:LocText Key=strViewManageLinkedFiles, Dict=Strings, Assembly=AssignmentsManage}" FontFamily="Arial" FontSize="15" Foreground="{StaticResource TitleTextForegroundBrush}" Height="29" Margin="10,10,12,0" Name="label1" VerticalAlignment="Top" />
        <ListBox ctr:ListBoxSelector.Enabled="True" Margin="12,45,12,41" Name="lstFiles" ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=my:LinkedFilesWindow, AncestorLevel=1}, Path=LinkedFiles}" SelectionChanged="lstFiles_SelectionChanged" SelectionMode="Extended" AllowDrop="True" Drop="lstFiles_Drop" MouseDoubleClick="lstFiles_MouseDoubleClick" ScrollViewer.HorizontalScrollBarVisibility="Disabled" DragOver="lstFiles_DragOver">
            <ListBox.Style>
                <Style TargetType="{x:Type ListBox}">
                    <Style.Triggers>
                        <Trigger Property="HasItems" Value="false">
                            <Setter Property="Background">
                                <Setter.Value>
                                    <ImageBrush ImageSource="/AssignmentsManage;component/Images/dragwatermark.PNG" Stretch="None" TileMode="None" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="HasItems" Value="true">
                            <Setter Property="Background">
                                <Setter.Value>
                                    <ImageBrush ImageSource="{x:Null}" Stretch="None" TileMode="None" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </ListBox.Style>
            <ListBox.ItemTemplate>
                <DataTemplate DataType="{x:Type dc:LinkedFile}">
                    <Border>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="30" />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>

                            <Image Source="{Binding Converter={StaticResource FileToIconConverter1}}" Name="imgFileIcon" />
                            <TextBlock Grid.Column="1" Text="{Binding Path=FileName}" VerticalAlignment="Center" Margin="5,0,0,0" Name="txtbFileName" TextTrimming="CharacterEllipsis" />
                        </Grid>
                    </Border>
                    <DataTemplate.Triggers>
                        <DataTrigger Binding="{Binding Path=FileFound}" Value="False">
                            <Setter TargetName="imgFileIcon" Property="ToolTip" Value="File Not Found" />
                            <Setter TargetName="txtbFileName" Property="Foreground" Value="Gray" />
                        </DataTrigger>
                    </DataTemplate.Triggers>
                </DataTemplate>
            </ListBox.ItemTemplate>
            <!--<ListBox.ItemContainerStyle>
                <Style TargetType="{x:Type ListBoxItem}">
                    <Setter Property="ContextMenu">
                        <Setter.Value>
                            <ContextMenu Name="ctxShellMenu" Loaded="ctxShellMenu_Loaded"></ContextMenu>
                        </Setter.Value>
                    </Setter>
                </Style>
            </ListBox.ItemContainerStyle>-->
        </ListBox>
        <StackPanel Orientation="Horizontal" Margin="12,0,174,6" Height="36" VerticalAlignment="Bottom">
            <ext:SplitButton Content="{lex:LocText Key=btnAddFiles, Dict=Strings, Assembly=AssignmentsManage}" Height="23" HorizontalAlignment="Left" Name="btnAdd" Click="btnAdd_Click" Margin="0,0,5,0" Padding="5,3,3,3">
                <ext:SplitButton.DropDownContent>
                    <StackPanel>
                        <MenuItem Header="{lex:LocText Key=mniAddURL, Dict=Strings, Assembly=AssignmentsManage}" Name="mniAddURL" Click="mniAddURL_Click" />
                        <MenuItem Header="Add File from SkyDrive (lang)" Click="MenuItem_Click" />
                    </StackPanel>
                </ext:SplitButton.DropDownContent>
            </ext:SplitButton>
            <Button Content="{lex:LocText Key=btnRemoveItems, Dict=Strings, Assembly=AssignmentsManage}" Height="23" HorizontalAlignment="Left" Name="btnRemove" IsEnabled="False" Click="btnRemove_Click" Padding="3,0,3,1" />
        </StackPanel>
        <Button Content="{lex:LocText Key=btnOK, Dict=Strings, Assembly=AssignmentsManage}" Height="23" HorizontalAlignment="Right" Margin="0,0,93,12" Name="btnOK" VerticalAlignment="Bottom" Width="75" IsDefault="True" Click="btnOK_Click" />
        <Button Content="{lex:LocText Key=btnCancel, Dict=Strings, Assembly=AssignmentsManage}" Height="23" HorizontalAlignment="Right" Margin="0,0,12,12" Name="btnCancel" VerticalAlignment="Bottom" Width="75" IsCancel="True" />
    </Grid>
</Window>
